use proto::protobuf_gen::example::GetRequest;

use protobuf::Message;

pub fn main() {
    let mut req = GetRequest::new();
    req.name = "222".to_string();
    req.age = 3;
    req.features = vec!["222".to_string(), "3333".to_string()];

    let bytes = req.write_to_bytes();

    if let Ok(b) = bytes {
        println!("bytes:{:?}", b);
        let req = GetRequest::parse_from_bytes(b.as_slice());
        if let Ok(r) = req {
            println!("req:{:?}", r);
        }
    }
}
